<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>转手商城-后台管理系统</title>
		<link rel="stylesheet" type="text/css" href="../static/layui/css/layui.css" />
		<link rel="stylesheet" type="text/css" href="../static/css/admin.css" />

		<script src="../static/js/public/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../static/js/public/jquery.session.js" type="text/javascript" charset="utf-8"></script>
		<script src="../static/js/public/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../static/js/public/axios.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../static/js/public/util.js" type="text/javascript" charset="utf-8"></script>

	</head>

	<body>
		<div class="main-layout" id='main-layout'>
			<!--侧边栏-->
			<div class="main-layout-side">
				<div class="m-logo">
				</div>
				<ul class="layui-nav layui-nav-tree" lay-filter="leftNav">
					<li class="layui-nav-item">
						<a href="javascript:;" data-id='1' data-text="用户管理"><i class="iconfont">&#xe606;</i>用户管理</a>
						<dl class="layui-nav-child">
						  <dd><a href="javascript:;" data-url="user/user-list.html" data-id='11' data-text="用户列表"><span class="l-line"></span>用户列表</a></dd>
						  <dd><a href="javascript:;" data-url="user/login-history-list.html" data-id='12' data-text="登录列表"><span class="l-line"></span>登录列表</a></dd>
						</dl>
					</li>
					<li class="layui-nav-item">
						<a href="javascript:;" data-id='2' data-text="商品管理"><i class="iconfont">&#xe607;</i>商品管理</a>
						<dl class="layui-nav-child">
						  <dd><a href="javascript:;" data-url="product/product-type-list.html" data-id='21' data-text="商品分类"><span class="l-line"></span>商品分类</a></dd>
						  <dd><a href="javascript:;" data-url="product/product-list.html" data-id='22' data-text="商品列表"><span class="l-line"></span>商品列表</a></dd>
						</dl>
					</li>
					<li class="layui-nav-item">
						<a href="javascript:;" data-url="#" data-id='3' data-text="订单管理"><i class="iconfont">&#xe602;</i>订单管理</a>
					</li>
					<li class="layui-nav-item">
						<a href="javascript:;" data-url="#" data-id='4' data-text="评论管理"><i class="iconfont">&#xe605;</i>评论管理</a>
					</li>
					<li class="layui-nav-item">
						<a href="javascript:;" data-url="#" data-id='5' data-text="公告管理"><i class="iconfont">&#xe608;</i>公告管理</a>
					</li>
					<li class="layui-nav-item">
						<a href="javascript:;" data-url="#" data-id='6' data-text="邮件管理"><i class="iconfont">&#xe603;</i>邮件管理</a>
					</li>
					<li class="layui-nav-item">
						<a href="javascript:;" data-url="#" data-id='7' data-text="模块管理"><i class="iconfont">&#xe604;</i>模块管理</a>
					</li>
					<li class="layui-nav-item">
						<a href="javascript:;" data-url="system/system.html" data-id='8' data-text="系统管理"><i class="iconfont">&#xe60b;</i>系统管理</a>
					</li>
				</ul>
			</div>
			<!--右侧内容-->
			<div class="main-layout-container" id="index">
				<!--头部-->
				<div class="main-layout-header">
					<div class="menu-btn" id="hideBtn">
						<a href="javascript:;">
							<span class="iconfont">&#xe60e;</span>
						</a>
					</div>
					<ul class="layui-nav" lay-filter="rightNav">
						<li class="layui-nav-item"><a href="javascript:;" data-url="#" data-id='6' data-text="邮件系统"><i class="iconfont">&#xe603;</i></a></li>
						<li class="layui-nav-item">
							<a href="javascript:;" data-url="user/admin-info.html" data-id='0' data-text="个人信息">{{name}}</a>
						</li>
						<li class="layui-nav-item"><a href="javascript:;" @click="loginOut()">退出</a></li>
					</ul>
				</div>
				<!--主体内容-->
				<div class="main-layout-body">
					<!--tab 切换-->
					<div class="layui-tab layui-tab-brief main-layout-tab" lay-filter="tab" lay-allowClose="true">
						<ul class="layui-tab-title">
							<li class="layui-this welcome">后台首页</li>
						</ul>
						<div class="layui-tab-content">
							<div class="layui-tab-item layui-show" style="background: #f5f5f5;">
								<iframe src="system/welcome.html" width="100%" height="100%" name="iframe" scrolling="auto" class="iframe" framborder="0"></iframe>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!--遮罩-->
			<div class="main-mask">

			</div>
		</div>

		<script src="../static/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		<script src="../static/js/common.js" type="text/javascript" charset="utf-8"></script>
		<script src="../static/js/main.js" type="text/javascript" charset="utf-8"></script>

		<script type="text/javascript">
			var vm = new Vue({
				el: '#index',
				data: {
					name: 'admin'
				},
				methods: {
					loadPage() {
						var _this = this;
						axios({
							method: 'get',
							url: getRootURL() + 'admin/get-admin',
							data: {},
							headers: {
								'Authorization': $.session.get("token")
							}
						}).then(function(res) {
							console.log(res);

							if (res.data.status >= 0) {
								_this.name = res.data.object.name
							} else {
								alert(res.data.msg);
							}

						}).catch(function(err) {
							alert(err);
						});
					},
					loginOut(){
						$.session.remove("token");
						$(location).attr('href', 'login.html');
					}
				},
				created() {
					this.loadPage()
				},
				mounted() {

				}
			})
		</script>

	</body>

</html>
